//
//  VisitorView.m
//  dwdWbOc
//
//  Created by Dengdwd on 15/10/9.
//  Copyright © 2015年 dwd. All rights reserved.
//

#import "VisitorView.h"

@interface VisitorView ()
@property (weak, nonatomic) IBOutlet UIImageView *smallIcon;
@property (weak, nonatomic) IBOutlet UIImageView *iconImage;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;

@end
@implementation VisitorView
- (void)setIconName:(NSString *)iconname descName:(NSString *)descName hasSmallIcon:(BOOL) isHas {
    self.iconImage.image = [UIImage imageNamed:iconname];
    self.descLabel.text = descName;
    self.smallIcon.hidden = !isHas;
    CABasicAnimation * basic = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
    basic.toValue = @(2 * M_PI);
    basic.repeatCount = MAXFLOAT;
    basic.duration = 5;
    basic.removedOnCompletion = NO;
    [self.smallIcon.layer addAnimation:basic forKey:nil];
    
}

- (IBAction)regist {
    if(self.registBlock)
    {
        self.registBlock();
    }
    
}
- (IBAction)login {
    if(self.loginBlock)
    {
        self.loginBlock();
    }
    
}

@end
